#include "../include/FireworkManager.h"

#include "../include/FireworkLib.h"

void FireworkManager::setFireworkCount(uint8_t fireworkCount) {
	m_fireworkCount = fireworkCount;
	for (int i = 0; i < m_fireworkCount; ++i) {
		m_fireworks.push_back(FireworkLib::getRandomFirework());
	}
}

void FireworkManager::update(std::chrono::nanoseconds delt) {
	for (auto& firework : m_fireworks) {
		firework->update(delt);
		if (firework->isDone()) {
			firework = FireworkLib::getRandomFirework();
		}
	}
}

void FireworkManager::see() {
	for (auto firework : m_fireworks) {
		firework->draw();
	}
}
